package com.fjwt.gz.service.mapper;

import com.fjwt.gz.db.entity.FansUserEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * 会员小程序openid/公众号openid表 Mapper 接口
 * </p>
 *
 * @author shiyonghao
 * @since 2025-04-09
 */
public interface FansUserMapper extends BaseMapper<FansUserEntity> {

    /**
     * 根据fansid 和 appid 获取用户信息
     * @param type
     * @param officialAppId
     * @return
     */
    FansUserEntity selectFansByFansIdAndAppid(@Param("type") String type, @Param("fansId") Long fansId, @Param("officialAppId") String officialAppId);

    /**
     * 根据fansid 和 appid 获取用户信息
     * @param type
     * @param appId
     * @return
     */
    FansUserEntity selectFansByOpenIdAndAppid(@Param("type") String type, @Param("openid") String openid, @Param("appId") String appId);


    /**
     * 根据fansid 和 activityId 获取用户信息
     * @param
     * @param activityId
     * @return
     */
    FansUserEntity selectUser(@Param("activityId") Long activityId,@Param("fansId")Long fansId);

    /**
     * 查询授权地址
     * @param activityId
     * @return
     */
    FansUserEntity selectAuthUrl(@Param("activityId") Long activityId);

    /**
     * 根据AppId和fansI的查询 OpenId
     * @param appId
     * @param fansId
     * @return
     */
    FansUserEntity findOpenidByAppIdAndFansId(@Param("appId") String appId, @Param("fansId") Long fansId);
}
